<!DOCTYPE html>
<html>

<head>
    <#include "/zf/admin/components/meta.html" />
    <title>蓁奕科技 ${metaTitleSuffix!}</title>
    <#include "/zf/admin/components/stylesheets.html" />
</head>

<body>
    <div id='app'>
        <el-container>
            <#assign menuIndex="1-2" />
            <#include "/zf/admin/components/menu.html" />
            <el-container>
                <#include "/zf/admin/components/header.html" />
                <el-main>
                    <template>
                         <el-date-picker v-model="dateRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" unlink-panels="true" :default-value="new Date">
                            </el-date-picker>
                         <el-input v-model="keyword" clearable placeholder="输入用户名搜索" style="width: 217px;"></el-input>
                            <el-button   @click="onSearch"><i class="el-icon-search"></i>搜索</el-button>
                        <el-table :data="items" style="width: 100%">
                            <!-- <el-table-column prop="id" label="id">
                            </el-table-column> -->
                            <el-table-column prop="nickName" label="微信名">
                            </el-table-column>
                           
                            <el-table-column prop="addTime" label="创建时间">
                            </el-table-column>
                       
                            <el-table-column  label="操作">
                                <template slot-scope="scope">
                                    <el-button  @click="detail(scope.row)" >查看</el-button>
                                </template>
                            </el-table-column>
                             <el-table-column prop="" label="下载">
                                  <template slot-scope="scope">
                                    <el-button @click="download(scope.row)" >下载</el-button>
                                </template>
                             
                            </el-table-column>
                        </el-table>
                        <#include '/components/page.html' />
                    </template>
                </el-main>
            </el-container>
        </el-container>
        <#include "/zf/admin/components/footer.html" />
    </div>
    <#include "/zf/admin/components/scripts.html" />
    <script type="text/javascript">
    var vue = new Vue({
        el: '#app',
        data() {
            return {
                time:'',
                items: toJson(`${items![]}`),
                keyword:'${keyword!}',
                 dateRange: ''


            }
        },
          

        mounted: function() {
              var startTime = '${startTime!""}'
            if (startTime != '') {
                this.dateRange = new Array;
                this.dateRange.push('${startTime!}');
                this.dateRange.push('${endTime!}');
            }
        },
        methods: {
             detail(info) {
                window.location.href = "/zf/admin/comment/list?openId=" + info.openId
            },
             onSearch() {
                var self = this;
                var keys = [  
                 { key: 'andTime', value: self.andTime },
                 { key: 'keyword', value: self.keyword }
                ]
                   if (self.dateRange != null && self.dateRange.length > 1) {
                    keys.push({ key: 'startTime', value: self.dateRange[0] });
                    keys.push({ key: 'endTime', value: self.dateRange[1] });
                } else {
                    keys.push({ key: 'startTime', value: '' });
                    keys.push({ key: 'endTime', value: '' });
                }
                goPage(1, keys);
            }
            ,
            download(info){
                   window.location.href = "/zf/admin/comment/list?openId=" + info.openId+"&dl=1"
            }
        }
           
    })
    </script>
</body>

</html>